package com.ruoyi.erp.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.erp.domain.LedyBudget;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.erp.mapper.LedyBudgetShareMapper;
import com.ruoyi.erp.domain.LedyBudgetShare;
import com.ruoyi.erp.service.ILedyBudgetShareService;

/**
 * 预算凭证分摊Service业务层处理
 * 
 * @author ztj
 * @date 2025-11-16
 */
@Service
public class LedyBudgetShareServiceImpl implements ILedyBudgetShareService 
{
    @Autowired
    private LedyBudgetShareMapper ledyBudgetShareMapper;

    /**
     * 查询预算凭证分摊
     * 
     * @param id 预算凭证分摊主键
     * @return 预算凭证分摊
     */
    @Override
    public LedyBudgetShare selectLedyBudgetShareById(Long id)
    {
        return ledyBudgetShareMapper.selectLedyBudgetShareById(id);
    }
    @Override
    public List<LedyBudgetShare> selectLedyBudgetShareByIds(Long[] ids)
    {
        return ledyBudgetShareMapper.selectLedyBudgetShareByIds(ids);
    }
    /**
     * 查询预算凭证分摊列表
     * 
     * @param ledyBudgetShare 预算凭证分摊
     * @return 预算凭证分摊
     */
    @Override
    public List<LedyBudgetShare> selectLedyBudgetShareList(LedyBudgetShare ledyBudgetShare)
    {
        return ledyBudgetShareMapper.selectLedyBudgetShareList(ledyBudgetShare);
    }

    /**
     * 新增预算凭证分摊
     * 
     * @param ledyBudgetShare 预算凭证分摊
     * @return 结果
     */
    @Override
    public int insertLedyBudgetShare(LedyBudgetShare ledyBudgetShare)
    {
        ledyBudgetShare.setCreateTime(DateUtils.getNowDate());
        return ledyBudgetShareMapper.insertLedyBudgetShare(ledyBudgetShare);
    }

    /**
     * 修改预算凭证分摊
     * 
     * @param ledyBudgetShare 预算凭证分摊
     * @return 结果
     */
    @Override
    public int updateLedyBudgetShare(LedyBudgetShare ledyBudgetShare)
    {
        ledyBudgetShare.setUpdateTime(DateUtils.getNowDate());
        return ledyBudgetShareMapper.updateLedyBudgetShare(ledyBudgetShare);
    }

    /**
     * 批量删除预算凭证分摊
     * 
     * @param ids 需要删除的预算凭证分摊主键
     * @return 结果
     */
    @Override
    public int deleteLedyBudgetShareByIds(Long[] ids)
    {
        return ledyBudgetShareMapper.deleteLedyBudgetShareByIds(ids);
    }

    /**
     * 删除预算凭证分摊信息
     * 
     * @param id 预算凭证分摊主键
     * @return 结果
     */
    @Override
    public int deleteLedyBudgetShareById(Long id)
    {
        return ledyBudgetShareMapper.deleteLedyBudgetShareById(id);
    }
}
